package cn.lingyangwl.agile.model;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;

/**
 * @author shenguangyang
 */
@NoArgsConstructor
@AllArgsConstructor
@Data
public class UiSelectOption {
    private String value;
    private String label;

    public UiSelectOption(String value) {
        this.value = value;
        this.label = value;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;

        if (o == null || getClass() != o.getClass()) return false;

        UiSelectOption that = (UiSelectOption) o;

        return new EqualsBuilder().append(value, that.value).append(label, that.label).isEquals();
    }

    @Override
    public int hashCode() {
        return new HashCodeBuilder(17, 37).append(value).append(label).toHashCode();
    }
}
